package red.uec.model;

import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@Data
public class RegisterRequest extends RestfulRequest {
    private static final long serialVersionUID = -3232648051963116795L;

    @NotNull(message = "请输入手机号码")
    @Pattern(regexp = "^1\\d{10}$", message = "请输入正确的手机号码")
    private String mobile;

    @NotNull(message = "请输入密码")
    @Pattern(regexp = "^.{8,20}$",
            message = "请输入正确的密码（8-20个字符）")
    private String password;

    /*@NotNull(message = "请输入电子邮箱")
    @Pattern(regexp = "^([a-z0-9A-Z]+[-|_|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$",
            message = "请输入正确的电子邮箱")
    private String email;*/

    @NotNull(message = "请输入短信验证码")
    @Pattern(regexp = "^[0-9]{6}$",
            message = "请输入正确的短信验证码")
    private String messageCode;

    private String messageCodeToken;
}
